//用户管理功能需要的store
import axios from 'axios'
import * as api from '../../ajax/api'

const state={
  usersData:[]
}
const actions={
  getUserData({commit}){
    return axios({
      url:api.GetUserData,
      method:'post'
    }).then(res=>{
      console.log('我也执行了')
      console.log(res)
      commit('addData',res.data)
      return res.code
    })
  }
}
const mutations={
  addData(state,obj){
    state.usersData= obj
  }
}



export default{
  state,
  actions,
  mutations
}